#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Action.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Classifier;
class InputPin;
class OutputPin;

/// <summary>
/// ReadIsClassifiedObjectAction
/// A ReadIsClassifiedObjectAction is an Action that determines whether an object is
/// classified by a given Classifier.
/// </summary>
class UMLMODEL_EXPORT ReadIsClassifiedObjectAction : public Action {

public: // Constructors and destructors
    explicit ReadIsClassifiedObjectAction(const QString& umlType="uml::ReadIsClassifiedObjectAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// classifier getter
    /// The Classifier against which the classification of the input object is tested.
    /// </summary>
    shared_ptr<Classifier> classifier() const;

    /// <summary>
    /// classifier setter
    /// The Classifier against which the classification of the input object is tested.
    /// </summary>
    void setClassifier(shared_ptr<Classifier> value);

    /// <summary>
    /// isDirect getter
    /// Indicates whether the input object must be directly classified by the given
    /// Classifier or whether it may also be an instance of a specialization of the
    /// given Classifier.
    /// </summary>
    bool isDirect() const;

    /// <summary>
    /// isDirect setter
    /// Indicates whether the input object must be directly classified by the given
    /// Classifier or whether it may also be an instance of a specialization of the
    /// given Classifier.
    /// </summary>
    void setIsDirect(bool value);

    /// <summary>
    /// object getter
    /// The InputPin that holds the object whose classification is to be tested.
    /// </summary>
    shared_ptr<InputPin> object() const;

    /// <summary>
    /// object setter
    /// The InputPin that holds the object whose classification is to be tested.
    /// </summary>
    void setObject(shared_ptr<InputPin> value);

    /// <summary>
    /// result getter
    /// The OutputPin that holds the Boolean result of the test.
    /// </summary>
    shared_ptr<OutputPin> result() const;

    /// <summary>
    /// result setter
    /// The OutputPin that holds the Boolean result of the test.
    /// </summary>
    void setResult(shared_ptr<OutputPin> value);

private: // Fields
    /// <summary>
    /// classifier
    /// The Classifier against which the classification of the input object is tested.
    /// </summary>
    shared_ptr<Classifier> classifier_;

    /// <summary>
    /// isDirect
    /// Indicates whether the input object must be directly classified by the given
    /// Classifier or whether it may also be an instance of a specialization of the
    /// given Classifier.
    /// </summary>
    const static bool isDirect_default_;
    bool isDirect_= isDirect_default_;

    /// <summary>
    /// object
    /// The InputPin that holds the object whose classification is to be tested.
    /// </summary>
    shared_ptr<InputPin> object_;

    /// <summary>
    /// result
    /// The OutputPin that holds the Boolean result of the test.
    /// </summary>
    shared_ptr<OutputPin> result_;

};

} // namespace uml
